package com.aoxin.service.impl.course.webCourse;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.aoxin.mapper.SlfMakeupCourseMapper;
import com.aoxin.model.SlfMakeupCourse;
import com.aoxin.service.inter.course.webCourse.MakeupCourseService;
import com.aoxin.util.EmptyUtil;
@Service
public class MakeupCourseServiceImpl implements MakeupCourseService {

    @Autowired
    SlfMakeupCourseMapper slfMakeupCourseMapper;

    @Override
    @Transactional
    public Integer deleteMakeupCourse(List<Integer> makeupCourseIds) {
        Integer result = 0;
        if(makeupCourseIds != null && makeupCourseIds.size() > 0){
            result = slfMakeupCourseMapper.deleteMakeupCourse(makeupCourseIds);
        }
        return result;
    }

    @Override
    @Transactional
    public Integer insertMakeupCourse(SlfMakeupCourse slfMakeupCourse) throws IllegalAccessException {
        Integer result = 0;
        if(!EmptyUtil.objFieldsIsEmpty(slfMakeupCourse)){
            result = slfMakeupCourseMapper.insertMakeupCourse(slfMakeupCourse);
        }
        return result;
    }

    @Override
    public List<SlfMakeupCourse> getMakeupCorse(SlfMakeupCourse slfMakeupCourse) {
		List<SlfMakeupCourse> slfMakeupCoursePageInfo = slfMakeupCourseMapper.getMakeupCorse(slfMakeupCourse);
        return slfMakeupCoursePageInfo;
    }

    @Override
    @Transactional
    public Integer updateMakeupCourse(SlfMakeupCourse slfMakeupCourse) throws IllegalAccessException {
        Integer result = 0;
        if(!EmptyUtil.objFieldsIsEmpty(slfMakeupCourse)){
            result = slfMakeupCourseMapper.updateMakeupCourse(slfMakeupCourse);
        }
        return result;
    }
}
